home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group94a.txt
/
000138_icon-group-sender _Tue May 24 08:13:20 1994.msg
< prev
next >
Wrap
Internet Message Format
|
1994-08-19
|
2KB
Received: by cheltenham.cs.arizona.edu; Tue, 24 May 1994 15:01:55 MST
Date: Tue, 24 May 94 08:13:20 PDT
From: kwalker@sirtur.premenos.com (Ken Walker)
Message-Id: <9405241513.AA01092@sirtur.premenos.com>
To: TENAGLIA@MIS.MCW.EDU, icon-group@cs.arizona.edu
Subject: Re: wishlist?
X-Sun-Charset: US-ASCII
Content-Length: 1155
Status: R
Errors-To: icon-group-errors@cs.arizona.edu
> From: Chris Tenaglia - 257-8765 <TENAGLIA@MIS.MCW.EDU>
>
> every n := 0.0 to &pi*2.0 by &pi/180.0 do ...
>
> 'every' cannot increment by reals. It can only do integers, strings,
> and structures.
Technically speaking the problem is not with 'every'; the problem is
with 'to by'. This is illustrated by writing a toby() procedure that
mimics 'to by', but works fine with reals:
procedure toby(From, To, By)
/By := 1
if From < To then {
if By <= 0 then
stop("infinite sequence specified for toby()")
while From <= To do {
suspend From
From +:= By
}
}
else {
if By >= 0 then
stop("infinite sequence specified for toby()")
while From >= To do {
suspend From
From +:= By
}
}
end
procedure main()
local From, To, By
repeat {
writes("from ")
From := read() | stop()
writes("to ")
To := read() | stop()
writes("by ")
By := read() | stop()
every write(" ", toby(From, To, By))
}
end
Ken Walker, kwalker@premenos.com